package programs;

import fsa.EpsilonRemover;
import fsa.FSA;
import fsa.GenerateDOT;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import program.Actor;
import program.Alt;
import program.Block;
import program.BlockList;
import program.Call;
import program.Loop;
import program.Main;
import program.Opt;
import traces.Method;
import traces.ObjectClass;
import traces.ObjectInstance;
import traces.Statement;
import traces.Trace;

public class d2 {
  /**
   * Fields for hack-imports only
   */
  private File importFile;
  
  private FileNotFoundException importFileNotFoundException;
  
  private IOException importIOException;
  
  private ArrayList<?> importArrayList;
  
  private EpsilonRemover importEpsilonRemover;
  
  private GenerateDOT importGenerateDOT;
  
  private FSA importFSA;
  
  private Actor importActor;
  
  private Alt importAlt;
  
  private Loop importLoop;
  
  private Opt importOpt;
  
  private Block importBlock;
  
  private BlockList importBlockList;
  
  private Call importCall;
  
  private Method importMethod;
  
  private ObjectInstance importObjectInstance;
  
  private ObjectClass importObjectClass;
  
  private Statement importStatement;
  
  private Trace importTrace;
  
  public static Main create() {
    int i= 0;
    ArrayList<Actor> actors= new ArrayList<Actor>();
                                      
    ObjectClass aClass=new ObjectClass("a");
    Actor a = new Actor("a", aClass);   
    actors.add(a);                                                 
                                      
    ObjectClass bClass=new ObjectClass("b");
    Actor b = new Actor("b", bClass);   
    actors.add(b);                                                 
    
    /* LOOP: loop_id2 */
    BlockList bloc_loop_id2 = new BlockList();
    
    Call m1_id3 = new Call(new Statement("S" + i++,a,new Method("m1",new ArrayList<ObjectInstance>(),bClass),b));
    
    Call m1_id4 = new Call(new Statement("S" + i++,a,new Method("m1",new ArrayList<ObjectInstance>(),bClass),b));
    
    //add(s) for loop_id2
    bloc_loop_id2.add(m1_id3);
    bloc_loop_id2.add(m1_id4);
    Loop loop_id2 = new Loop(bloc_loop_id2);
    
    ArrayList<Block> entry_point_id5 = new ArrayList<Block>();
    entry_point_id5.add(loop_id2);
    return new Main(entry_point_id5, actors, 200);
    
  }
  
  public static void main(String[] arg) {
    Main sd=create();
    boolean ok=sd.saveModel("d2");
    if (ok){
        sd.genereAllTraces("d2", 100);
    }
    
  }
}
